package cn.ibizlab.todo.core.pms.client;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.todo.core.pms.domain.Action;
import cn.ibizlab.todo.core.pms.filter.ActionSearchContext;
import org.springframework.cloud.openfeign.FeignClient;

/**
 * 实体[Action] 服务对象接口
 */
@FeignClient(value = "${ibiz.ref.service.pms-webapi:pms-webapi}", contextId = "Action", fallback = ActionFallback.class)
public interface ActionFeignClient {

    @RequestMapping(method = RequestMethod.GET, value = "/actions/select")
    Page<Action> select();


    @RequestMapping(method = RequestMethod.POST, value = "/actions")
    Action create(@RequestBody Action action);

    @RequestMapping(method = RequestMethod.POST, value = "/actions/batch")
    Boolean createBatch(@RequestBody List<Action> actions);


    @RequestMapping(method = RequestMethod.PUT, value = "/actions/{id}")
    Action update(@PathVariable("id") Long id,@RequestBody Action action);

    @RequestMapping(method = RequestMethod.PUT, value = "/actions/batch")
    Boolean updateBatch(@RequestBody List<Action> actions);


    @RequestMapping(method = RequestMethod.DELETE, value = "/actions/{id}")
    Boolean remove(@PathVariable("id") Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/actions/batch}")
    Boolean removeBatch(@RequestBody Collection<Long> idList);


    @RequestMapping(method = RequestMethod.GET, value = "/actions/{id}")
    Action get(@PathVariable("id") Long id);


    @RequestMapping(method = RequestMethod.GET, value = "/actions/getdraft")
    Action getDraft();


    @RequestMapping(method = RequestMethod.POST, value = "/actions/checkkey")
    Boolean checkKey(@RequestBody Action action);


    @RequestMapping(method = RequestMethod.POST, value = "/actions/save")
    Boolean save(@RequestBody Action action);

    @RequestMapping(method = RequestMethod.POST, value = "/actions/savebatch")
    Boolean saveBatch(@RequestBody List<Action> actions);



    @RequestMapping(method = RequestMethod.POST, value = "/actions/searchdefault")
    Page<Action> searchDefault(@RequestBody ActionSearchContext context);



    @RequestMapping(method = RequestMethod.POST, value = "/actions/searchtype")
    Page<Action> searchType(@RequestBody ActionSearchContext context);


}
